using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using MvcContrib;
using DecisionMaking.BusinessLogic;
using DecisionMaking.BusinessLogic.Model;
namespace DecisionMaking.WebApp
{
	[HandleError]
	public class CuesController : BaseController
	{
		/// <summary>
		/// Injected by Windsor 
		/// </summary>
		public IEnvironmentManager EnvironmentManager {private get; set;}	
		
		[HttpGet]
		// TODO secure
		public ActionResult List(int id)
		{
			var cues = EnvironmentManager.GetCues(id);
			
			ViewData["cueAttributes"] = EnvironmentManager.GetCueAttributes(id); // needed for dynamically building the columns
			ViewData["cues"] = cues;
			
			// pre-set the environment id for the new cue form model
			return View("List", new CueModel{EnvironmentId = id}); 
		}
	}
}

